<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
body,td,th {
	font-size: 16px;
	color: #036;
}
.table1 {
	border-top:#006 1px solid;
	border-right:#006 1px solid;
}
.table1 td {
	border-bottom:#006 1px solid;
	border-left:#006 1px solid;
	padding:3px 4px 3px 4px;
}
	
</style>
</head>
<body>
<?php
$name=$_POST['name'];
$gender=$_POST['gender'];
$point=$_POST['point'];
if($name==''){
	echo '请填写姓名';
}else if($gender==''){
	echo '请选择性别';
}else if($point==''){
	echo '请填写分数';
}else{
	$conn=mysql_connect('127.0.0.1:3306','betty','123qwe');
mysql_query("SET NAMES 'utf8'",$conn);
mysql_select_db('betty',$conn);
$sql="INSERT INTO `scord1`(`name`,`gender`,`point`) VALUES ($_name,$_gender,$point)";
$return=mysql_query($sql,$conn);
if($return){
	echo '提交成功';
}else{
	echo '提交失败'.mysql_error();
}
}
?>
<form id="form1" name="form1" method="post" action="3list.php">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="table1">

  <tr>
    <td align="center"colspan="2">成绩录入表</td>
  </tr>
  <tr>
    <td>姓名</td>
    <td><input type="text" name="name" id="textfield" /></td>
  </tr>
  <tr>
    <td><p>性别</p></td>
    <td>
<label><input type="radio" name="gender" id="radio" value="1" />男</label>
<label><input type="radio" name="gender" id="radio2" value="2" />女</label>
</td>
  </tr>
  <tr>
    <td>分数</td>
    <td><input type="text" name="point" id="textfield2" /></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit" name="button" id="button" value="提交" /><a href="1add.php">返回</a></td>
  </tr>
</table>
</form>
</body>
</html>